package com.nbsaas.boot.controller.product;

import com.nbsaas.boot.product.api.apis.ProductSkuApi;
import com.nbsaas.boot.product.api.domain.request.ProductSkuSearch;
import com.nbsaas.boot.product.api.domain.simple.ProductSkuSimple;
import com.nbsaas.boot.rest.response.ListResponse;
import com.nbsaas.boot.rest.response.PageResponse;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
*  对外控制器
*/
@RestController
@RequestMapping("/productSku")
public class ProductSkuController {


    @Resource
    private ProductSkuApi productSkuApi;


    @RequestMapping("/search")
    public PageResponse <ProductSkuSimple> search(@RequestBody ProductSkuSearch request) {
        return productSkuApi.search(request);
    }

    @RequestMapping("/list")
    public ListResponse<ProductSkuSimple> list(@RequestBody ProductSkuSearch request) {
        return productSkuApi.list(request);
    }

}